<template>
  <div class="technicItem">
    <div class="left">
      <div class="top" van-multi-ellipsis--l2>
        {{ info.title }}
      </div>
      <div class="bottom">
        <div class="b1">{{ info.updated_at | formatTime }}</div>
        <div class="b2 iconfont">&#xe644;</div>
        <div class="b3">{{ info.read }}</div>
        <div class="b4 iconfont">&#xe638;</div>
        <div class="b5">{{ info.star }}</div>
      </div>
    </div>
    <img v-if="info.cover" :src="$baseUrl + info.cover" alt="" class="right" />
  </div>
</template>

<script>
// import moment from 'moment'
export default {
  props: ['info'],
  // 过滤器
  filters: {
    //  formatTime (time) {
    //    const _time = moment(time)
    //    const _localTime = moment()
    //    const _diff = _localTime.diff(_time, 'h')
    //    if (_diff < 1) {
    //      return '刚刚'
    //    } else if (_diff < 24) {
    //      return _diff + '小时前'
    //    } else {
    //      return _time.format('YYYY/MM/DD HH:mm:ss')
    //    }
    //  }
  }
}
</script>
<style lang="less" scoped>
.technicItem {
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  .left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .top {
      font-size: 16px;
      font-family: PingFangSC, PingFangSC-Medium;
      font-weight: 500;
      text-align: left;
      color: #181a39;
      line-height: 22px;
      letter-spacing: 0px;
    }
    .bottom {
      display: flex;
      align-items: center;
      font-size: 12px;
      color: #ccc;
      .b1 {
        flex: 1;
      }
    }
  }
  .right {
    margin-left: 15px;
    width: 113px;
    height: 75px;
    object-fit: cover;
  }
}
</style>
